

package com.kun.auth.handler;

import com.kun.util.WebfluxResponseUtil;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.server.authorization.ServerAccessDeniedHandler;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * 权限不足
 *
 * @author kun.li
 */
public class BearerTokenServerAccessDeniedHandler implements ServerAccessDeniedHandler {

    @Override
    public Mono<Void> handle(ServerWebExchange exchange, AccessDeniedException denied) {
        return WebfluxResponseUtil.responseFailed(exchange, 200,403, "权限不足");

    }

}
